<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>固定定位</title>
  <style>
    .container {
      width: 1000px;
      height: 800px;
      border: 1px solid purple;
      position: fixed;
      margin-left: 200px;
    }
    div {
      width: 200px;
      height: 100px;
    }
    .c1{
      background: blue;
      position: fixed;
      z-index: 5;
      left: 200px;
      top: 0px;
    }
    .c2{
      background: #1f389c;
      position: fixed;
      z-index: 2;
      top:100px;
      left: 0px;
    }
    .c3{
      background: green;
      position: fixed;
      z-index: 3;
      left: 200px;
      top: 200px;
    }
    .c4{
      background: red;
      position: fixed;
      z-index: 2;
      left: 400px;
      top:100px;
    }

  </style>
</head>
<body>
<div class="container">
  <div class="c1"></div>
  <div class="c2"></div>
  <div class="c3"></div>
  <div class="c4"></div>
</div>
</body>
</html>